<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<title>湖南省自来水公司营销管理信息系统</title>

	<link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/text.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/form.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/buttons.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/grid.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/layout.css" type="text/css" media="screen" title="no title" />

	<link rel="stylesheet" href="../css/ui-darkness/jquery-ui-1.8.12.custom.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/jquery.visualize.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/facebox.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/uniform.default.css" type="text/css" media="screen" title="no title" />
	<link rel="stylesheet" href="../css/plugin/dataTables.css" type="text/css" media="screen" title="no title" />

	<link rel="stylesheet" href="../css/custom.css" type="text/css" media="screen" title="no title">
</head>

<body>

<div id="wrapper">



	<div id="header">

		<div class="content_pad">
			<h1><a href="../workspace.html">湖南省自来水公司营销管理信息系统</a></h1>

			<ul id="nav">

				<li class="nav_dropdown nav_icon">
					<a href="javascript:;"><span class="ui-icon ui-icon-wrench"></span>业扩工程</a>

					<div class="nav_menu">
						<ul>
							<li><a href="../page/be__request.html">01 用户申请</a></li>
							<li><a href="../page/be__audit.html">02 初步审核</a></li>
							<li><a href="../page/be__pay.html">03 交施工费</a></li>
							<li><a href="../page/be__billclear.html">04 水费清算</a></li>
							<li><a href="../page/be__contract.html">05 供水协议</a></li>
							<li><a href="../page/be__working.html">06 施工竣工</a></li>
							<li><a href="../page/be__open.html">07 通水停水</a></li>
							<li><a href="../page/be__save.html">08 档案存档</a></li>
							<li><a href="../page/be_order.html">工单管理</a></li>
							<li><a href="../page/be_abort.html">终止工单</a></li>
							<li><a href="../page/be_reportProgress.html">业扩工程进度</a></li>
							<li><a href="../page/be_reportMoney.html">业扩收费报表</a></li>
						</ul>

					</div>
				</li>

				<li class="nav_dropdown nav_icon">
					<a href="javascript:;"><span class="ui-icon ui-icon-person"></span>用户管理</a>

					<div class="nav_menu">
						<ul>
							<li><a href="../page/user_search.html">用户查询</a></li>
							<li><a href="../page/user_add.html">快捷新户</a></li>
							<li><a href="../page/user_changeName.html">快捷过户</a></li>
							<li><a href="../page/user_changeBank.html">快捷代扣</a></li>
							<li><a href="../page/user_changeMeter.html">快捷换表</a></li>
							<li><a href="../page/user_changeFormula.html">快捷重签</a></li>
							<li><a href="../page/user_delete.html">快捷销户</a></li>
							<li><a href="../page/user_reportShortcut.html">快捷操作记录</a></li>
							<li><a href="../page/user_docNum.html">档案号管理</a></li>
							<li><a href="../page/user_sendMsg.html">短信群发</a></li>
						</ul>

					</div>
				</li>

				<li class="nav_dropdown nav_icon">
					<a href="javascript:;"><span class="ui-icon ui-icon-pencil"></span>抄表管理</a>

					<div class="nav_menu">
						<ul>
							<li><a href="../page/rd_volume.html">表册管理</a></li>
							<li><a href="../page/rd_init.html">抄表初始化</a></li>
							<li><a href="../page/rd_task.html">任务分配</a></li>
							<li><a href="../page/rd_enter.html">抄表录入</a></li>
							<li><a href="../page/rd_audit.html">抄表审核</a></li>
							<li><a href="../page/rd_reportReading.html">抄表情况查询</a></li>
							<li><a href="../page/rd_reportVolumeReading.html">抄表统计报表</a></li>
							<li><a href="../page/rd_reportZero.html">零吨位用户查询</a></li>
							<li><a href="../page/rd_reportMaxValue.html">最大码值修正记录</a></li>
							<li><a href="../page/rd_reportCPreAmount.html">底码修正记录</a></li>
							<li><a href="../page/rd_reportMeterCheck.html">水表周检报表</a></li>
						</ul>

					</div>
				</li>

				<li class="nav_dropdown nav_icon">
					<a href="javascript:;"><span class="ui-icon ui-icon-star"></span>收费管理</a>

					<div class="nav_menu">
						<ul>
							<li><a href="../page/pay_window.html">窗口收费</a></li>
							<li><a href="../page/pay_batch.html">批量收费</a></li>
							<li><a href="../page/pay_invoiceReprint.html">发票补开/作废</a></li>
							<li><a href="../page/pay_reportDebts.html">欠费报表</a></li>
							<li><a href="../page/pay_reportPay.html">收费情况报表</a></li>
							<li><a href="../page/pay_reportMonthRecycle.html">月资金回收情况报表</a></li>
							<li><a href="../page/pay_reportBalance.html">用户预收情况报表</a></li>
							<li><a href="../page/pay_reportWaterType.html">各类用水统计总表</a></li>
						</ul>

					</div>
				</li>

				<li class="nav_dropdown nav_icon">
					<a href="javascript:;"><span class="ui-icon ui-icon-script"></span>发票管理</a>

					<div class="nav_menu">
						<ul>
							<li><a href="../page/inv_invoiceManage.html">发票总表</a></li>
							<li><a href="../page/inv_invoiceIn.html">发票入库</a></li>
							<li><a href="../page/inv_invoiceOut.html">发票出库</a></li>
							<li><a href="../page/inv_invoiceArchive.html">发票交票</a></li>
							<li><a href="../page/inv_invoiceReportOut.html">发票出库情况查询</a></li>
							<li><a href="../page/inv_invoiceReportEmp.html">收费人员发票查询</a></li>
							<li><a href="../page/inv_invoiceReportArchive.html">发票交票情况查询</a></li>
							<li><a href="../page/inv_invoiceReportUse.html">发票使用情况查询</a></li>
							<li><a href="../page/inv_invoiceReportMoneySum.html">销账汇总报表</a></li>
							<li><a href="../page/inv_invoiceReportMoneyDetail.html">销账明细报表</a></li>
						</ul>
					</div>
				</li>

				<li class="nav_dropdown nav_icon">
					<a href="javascript:;"><span class="ui-icon ui-icon-gear"></span>系统设置</a>

					<div class="nav_menu">
						<ul>
							<li><a href="../page/sys_area.html">抄表辖区</a></li>
							<li><a href="../page/sys_meterType.html">水表型号</a></li>
							<li><a href="../page/sys_dept.html">部门管理</a></li>
							<li><a href="../page/sys_emp.html">员工管理</a></li>
							<li><a href="../page/sys_menupower.html">菜单权限设置</a></li>
							<li><a href="../page/sys_areapower.html">辖区权限设置</a></li>
							<li><a href="../page/sys_waterType.html">用水类型设定</a></li>
							<li><a href="../page/sys_surcharge.html">附加费设定</a></li>
							<li><a href="../page/sys_flow.html">流程配置</a></li>
						</ul>

					</div>
				</li>

				<li class="nav_current nav_dropdown nav_icon_only">
					<a href="javascript:;">&nbsp;</a>

					<div class="nav_menu">
						<ul>
							<li><a href="../workspace.html">我的工作台</a></li>
							<li><a href="../page/sys_pwd.html">修改密码</a></li>
							<li><a href="/autoWater/logout">退出系统</a></li>
						</ul>
					</div> <!-- .menu -->
				</li>
			</ul>
		</div> <!-- .content_pad -->

	</div> <!-- #header -->

	<div id="masthead">
		<div>
			<span id="pagetitle"><a href="javascript:;">工单管理</a></span>
			<span id="welcome_span">欢迎回来，{{username.empName}}</span>
		</div>
	</div> <!-- #masthead -->

	<div id="content" class="xgrid">


		<div class="x12">

			<h2>工单管理</h2>

			<div class="height40">
				工单类型 <select v-model="orderType">
					<option value="0">所有</option>
					<option value="1">新户</option>
					<option value="2">分户</option>
					<option value="3">过户</option>
					<option value="4">代扣</option>
					<option value="5">换表</option>
					<option value="6">重签</option>
					<option value="7">销户</option>
				</select>
				工程进度 <select v-model="orderJd">
					<option value="10">所有</option>
					<option value="1">初步审核</option>
					<option value="2">交施工费</option>
					<option value="3">水费清算</option>
					<option value="4">供水合同</option>
					<option value="5">施工竣工</option>
					<option value="6">通水停水</option>
					<option value="7">档案存档</option>
					<option value="8">完成</option>
					<option value="-1">终止</option>
				</select>
				工单号 <input v-model="orderNo"/>
				用户姓名 <input v-model="userName"/>
				<label><input type="checkbox" style="vertical-align:middle;" @click="dwcl"/>等待我处理</label>
				<button class="btn btn-small btn-icon btn-find" @click="cxgd"><span></span>查询工单</button>
			</div>

			<table class="data display">
				<thead>
				<tr>
					<th width="120">工单号</th>
					<th width="60">类型</th>
					<th width="80">进度</th>
					<th width="90">当前处理部门</th>
					<th width="100">最后操作日期</th>
					<th width="200">用户名称</th>
					<th></th>
				</tr>
				</thead>
				<tbody>
				<!--有工单的情况-->
				<tr v-if="beOrderList.length !== 0" v-for="(item, index) in beOrderList" :class="[index % 2 === 0 ? 'even' : 'odd']">
					<td><a :href="'../page/be_orderInfo.html?order=' + item.orderNo" target="orderInfo">{{ item.orderNo }}</a></td>
					<td v-text="item.orderType==1?'新户':item.orderType==2?'分户':item.orderType==3?'过户':item.orderType==4?'代扣':item.orderType==5?'换表':item.orderType==6?'重签':'销户'"></td>
					<td v-text="item.stepID==1?'初步审核':item.stepID==2?'交施工费':item.stepID==3?'水费清算':item.stepID==4?'供水协议':item.stepID==5?'施工竣工':item.stepID==6?'通水停水':item.stepID==7?'档案存档':item.stepID==8 || item.stepID==0?'完成':'终止'"></td>
					<td v-text="item.stepID==1 || item.stepID==4 || item.stepID==7?'生技室':item.stepID==2?'财务部':item.stepID==3?'收费室':item.stepID==5?'安装队':item.stepID==6?'抄表班':''"></td>
					<td>{{ item.lastEditDate }}</td>
					<td>{{ item.userName }}</td>
					<td v-if="username.deptID==2 && item.stepID==1"><button class="btn-icon btn-small btn-blue btn-check" @click="handleOrder(item)"><span></span>处理</button></td>
					<td v-if="username.deptID==2 && item.stepID==7 && (item.orderType==1 || item.orderType==2 || item.orderType==5 || item.orderType==7)"><button class="btn-icon btn-small btn-blue btn-check" @click="handleOrder(item)"><span></span>处理</button></td>
					<td v-if="username.deptID==2 && item.stepID==4 &&(item.orderType==3 || item.orderType==7)"><button class="btn-icon btn-small btn-blue btn-check" @click="handleOrder(item)"><span></span>处理</button></td>
					<td v-if="username.deptID==3 && item.stepID==2"><button class="btn-icon btn-small btn-blue btn-check" @click="handleOrder(item)"><span></span>处理</button></td>
					<td v-if="username.deptID==1"><button class="btn-icon btn-small btn-blue btn-check" @click="handleOrder(item)"><span></span>处理</button></td>
					<td v-if="username.deptID==4 && item.stepID==3 && (item.orderType==1 || item.orderType==2 || item.orderType==5)"><button class="btn-icon btn-small btn-blue btn-check" @click="handleOrder(item)"><span></span>处理</button></td>
					<td v-if="username.deptID==5 && item.stepID==6 && (item.orderType==1 || item.orderType==2 || item.orderType==5)"><button class="btn-icon btn-small btn-blue btn-check" @click="handleOrder(item)"><span></span>处理</button></td>
					<td v-if="username.deptID==7 && item.stepID==5 && (item.orderType==1 || item.orderType==2 || item.orderType==6)"><button class="btn-icon btn-small btn-blue btn-check" @click="handleOrder(item)"><span></span>处理</button></td>
				</tr>
				</tbody>
			</table>
			<div class="page">
				<a @click="goFirstPage">第一页</a>
				<a @click="goPrevPage">上一页</a>
				<input class="pageIndex" v-model="currentPage"/> / <input class="pageCount" readonly="readonly" :value="pageInfo.pages" />
				<a @click="goNextPage">下一页</a>
				<a @click="goLastPage">最后一页</a>
			</div>

		</div> <!-- .x12 -->

	</div> <!-- #content -->

	<div id="footer">
		<div class="content_pad">
			<p>&copy; 2013-11 版权所有 <a href="#">湖南省自来水公司</a>.   技术支持 <a href="#">职业教育</a>.</p>
		</div> <!-- .content_pad -->
	</div> <!-- #footer -->

</div> <!-- #wrapper -->

<script src="../js/jquery/jquery-1.5.2.min.js"></script>
<script src="../js/jquery/jquery-ui-1.8.12.custom.min.js"></script>
<script src="../js/misc/excanvas.min.js"></script>
<script src="../js/jquery/facebox.js"></script>
<script src="../js/jquery/jquery.visualize.js"></script>
<script src="../js/jquery/jquery.dataTables.min.js"></script>
<script src="../js/jquery/jquery.tablesorter.min.js"></script>
<script src="../js/jquery/jquery.uniform.min.js"></script>
<script src="../js/jquery/jquery.placeholder.min.js"></script>

<script src="../js/widgets.js"></script>
<script src="../js/dashboard.js"></script>
<script src="../js/axios.js"></script>
<script src="../js/vue3.js"></script>

<script type="text/javascript">
	const app = Vue.createApp({
		data() {
			return {
				username: JSON.parse(sessionStorage.getItem("user")), //登录的用户
				beOrderList: '', //所有工程单
				pageInfo: {}, //分页数据
				currentPage: 1 ,//当前页码

				checkK:true,//等待我处理的是否选中
				orderNo:"",//工单号
				userName:"",//用户姓名
				orderType:0,//工单类型
				orderJd:10,//工程进度
			}
		},
		computed: {
			//时间
			formattedDate() {
				return (date) => {
					var options={}
					if(date!=="") {
						options = {
							year: 'numeric',
							month: '2-digit',
							day: '2-digit',
							hour: '2-digit',
							minute: '2-digit',
							second: '2-digit'
						};
						return new Date(date).toLocaleString('zh-CN', options);
					}
					return "";
				};
			},
		},
		mounted() {
			this.getBeOrderList();
		},
		methods: {
			// 获取工单列表和分页数据
			getBeOrderList(deptID) {
				axios.get('/beOrder/gdgl', {
					params: {
						pageNum: this.currentPage,
						pageSize: 10 ,// 每页显示10条记录
						deptID:deptID,//部门
						orderNo:this.orderNo,//工单号
						userName:this.userName,//用户姓名
						orderType:this.orderType,//工单类型
						orderJd:this.orderJd,//工程进度
					}
				}).then((response) => {
					this.beOrderList = response.data.data.records;
					this.pageInfo = response.data.data;
				}).catch((error) => {
					console.error(error);
				});
				Dashboard.init ();
			},
			// 切换到第一页
			goFirstPage() {
				this.currentPage = 1;
				this.getBeOrderList();
			},
			// 切换到上一页
			goPrevPage() {
				if (this.currentPage > 1) {
					this.currentPage--;
					this.getBeOrderList();
				}
			},
			// 切换到下一页
			goNextPage() {
				if (this.currentPage < this.pageInfo.pages) {
					this.currentPage++;
					this.getBeOrderList();
				}
			},
			// 切换到最后一页
			goLastPage() {
				this.currentPage = this.pageInfo.pages;
				this.getBeOrderList();
			},
			//处理
			handleOrder(order){
				if(order.stepID===1){
					//初步审核
					location.href="be__auditForm.html?order="+order.orderNo;
				}else if(order.stepID===2){
					//交施工费
					location.href="be__payForm.html?order="+order.orderNo;
				}else if(order.stepID===3){
					//水费清算
					location.href="be__billclearForm.html?order="+order.orderNo;
				}else if(order.stepID===4){
					//供水协议
					location.href="be__contractForm.html?order="+order.orderNo;
				}else if(order.stepID===5){
					//施工竣工
					location.href="be__workingForm.html?order="+order.orderNo;
				}else if(order.stepID===6){
					//通水停水
					location.href="be__openForm.html?order="+order.orderNo;
				}else if(order.stepID===7){
					//档案存档
					location.href="be__saveForm.html?order="+order.orderNo;
				}
			},
			//等我处理
			dwcl(){
				if(this.checkK) {
					this.checkK=false;
					this.getBeOrderList(this.username.deptID)

				}else {
					this.checkK=true;
					this.getBeOrderList();
				}
			},
			cxgd(){
				this.getBeOrderList()
			}
		}
	});
	app.mount('#wrapper');
</script>

</body>

</html>
